<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/webCommon/webCommon.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>文件添加</title>

<script type="text/javascript" src="plugins/layui/layui.js"></script>
		<script>
			layui.use(['form', 'layedit', 'laydate'], function() {
				var form = layui.form(),
					layer = layui.layer,
					layedit = layui.layedit,
					laydate = layui.laydate;
				 //监听提交
				form.on('submit(tijiao)', function(data) {
					layer.alert(JSON.stringify(data.field), {
						title: '最终的提交信息'
					})
				});
				 //执行一个laydate实例
				  laydate.render({
				    elem: '#fileStartTime' //指定元素
				    ,type: 'datetime'
				  });
				  layui.upload({
					  url: '上传接口url'
					  ,success: function(res){
					    console.log(res); //上传成功返回值，必须为json格式
					  }
					});      
			});
		</script>
</head>

<body>
	<div style="margin: 15px;">
		 <form class="layui-form" action="<%=basePath%>/sys/SysFile_add.action"  enctype="multipart/form-data" method="post">
		 <div class="layui-form-item">
					<label class="layui-form-label">所属产品-班别</label>
					<div class="layui-input-inline">
						<select name="classId" id="classId">
							<option value="">请选择...</option>
							<s:iterator value="sysClassAllList">
							<option value="${classId}" id="${classId}">${className}</option>
							</s:iterator>
						</select>
					</div>
		 </div>
		 <div class="layui-form-item">
					<label class="layui-form-label">所属分类-组名</label>
					<div class="layui-input-inline">
						<select name="studentGroupId" id="studentGroupId">
							<option value="">请选择...</option>
							<s:iterator value="serviceStudentGroupAllList">
							<option value="${studentGroupId}" id="${studentGroupId}">${studentGroupName}</option>
							</s:iterator>
						</select>
					</div>
		 </div>
		  <div class="layui-form-item">
					<label class="layui-form-label">文件类型</label>
					<div class="layui-input-block">
						<input type="radio" name="fileType" value="0" title="文档" checked="">
						<input type="radio" name="fileType" value="1" title="作品">
				<!-- 		<input type="radio" name="sex" value="禁" title="禁用" disabled=""> -->
					</div>
				</div>
				
			<div class="layui-form-item">
				<label class="layui-form-label">文件别名</label>
				<div class="layui-input-inline">
					<input type="text" name="fileNickName" lay-verify="fileNickName" autocomplete="off" placeholder="文件别名" class="layui-input">
				</div>
			</div>
			
				<div class="layui-form-item">
					<label class="layui-form-label">关键字</label>
					<div class="layui-input-inline">
						<input type="text" name="fileKey" lay-verify="fileKey" autocomplete="off" placeholder="关键字" class="layui-input">
					</div>
				</div>
		
			<div class="layui-form-item">
				<label class="layui-form-label">文件简介</label>
				<div class="layui-input-inline">
					<input type="text" name="fileProfile" lay-verify="fileProfile" autocomplete="off" placeholder="简介" class="layui-input">
				</div>
			</div>
			
			
			
			 <div class="layui-inline-item"  >
				<label class="layui-form-label">附件</label>
					<div class="layui-input-inline">
						<div class="site-doc-icon">
		                	  <input type="file" name="upload" id="upload">
						</div>
				</div>
			</div>
			
			<div class="layui-form-item">
					<div class="layui-input-block">
						<button id="tijiao" class="layui-btn" lay-filter="tijiao" lay-submit="">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
		</form>
	</div>
	
	<!-- 
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  <legend>顺便列举几个常用例子</legend>
</fieldset>
<div class="layui-inline">
  <input class="layui-input" placeholder="自定义日期格式" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
</div>
<div class="layui-inline">
  <input class="layui-input" placeholder="开启节日" onclick="layui.laydate({elem: this, festival: true})">
</div>
<div class="layui-inline">
  <input class="layui-input" placeholder="只能选昨天到明天" onclick="layui.laydate({elem: this, min: laydate.now(-1), max: laydate.now(+1)})">
</div>
<div class="layui-form-pane" style="margin-top: 15px;">
  <div class="layui-form-item">
    <label class="layui-form-label">范围选择</label>
    <div class="layui-input-inline">
      <input class="layui-input" placeholder="开始日" id="LAY_demorange_s">
    </div>
    <div class="layui-input-inline">
      <input class="layui-input" placeholder="截止日" id="LAY_demorange_e">
    </div>
  </div>
</div>       -->         
<!-- <script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>  
<script src="layui.js" charset="utf-8"></script>    -->     
<!-- <script>
layui.use('laydate', function(){
  var laydate = layui.laydate;
  
  var start = {
    min: laydate.now()
    ,max: '2099-06-16 23:59:59'
    ,istoday: false
    ,choose: function(datas){
      end.min = datas; //开始日选好后，重置结束日的最小日期
      end.start = datas //将结束日的初始值设定为开始日
    }
  };
  
  var end = {
    min: laydate.now()
    ,max: '2099-06-16 23:59:59'
    ,istoday: false
    ,choose: function(datas){
      start.max = datas; //结束日选好后，重置开始日的最大日期
    }
  };
  
  document.getElementById('LAY_demorange_s').onclick = function(){
    start.elem = this;
    laydate(start);
  }
  document.getElementById('LAY_demorange_e').onclick = function(){
    end.elem = this
    laydate(end);
  }
  
});
</script>  -->
	
	
</body>
</html>
